<meta charset="UTF-8">
<h1>f12查看效果</h1>


<script src="./utils.js"></script>
<h1>查看效果</h1>

<h2>01-刚刚、几分钟前、几小时前....</h2>
<div id="box1"></div>
<script>

    var result1 = `` 
    result1 += `相对于2022-04-14 17:03:00 而言<br/>`
    result1 += `dateFormat('2022-04-14 17:02:45') &nbsp&nbsp&nbsp  时间为 ${dateFormat('2022-04-14 17:02:45')} <br>`
    result1 += `dateFormat('2022-04-14 17:02:15') &nbsp&nbsp&nbsp  时间为 ${dateFormat('2022-04-14 17:02:15')} <br>`
    result1 += `dateFormat('2022-04-14 17:01:00') &nbsp&nbsp&nbsp  时间为 ${dateFormat('2022-04-14 17:01:00')} <br>`
    result1 += `dateFormat('2022-04-14 16:03:00') &nbsp&nbsp&nbsp  时间为 ${dateFormat('2022-04-14 16:03:00')} <br>`
    result1 += `dateFormat('22022-04-13 17:03:00') &nbsp&nbsp&nbsp  时间为 ${dateFormat('2022-04-13 17:03:00')} <br>`
    result1 += `dateFormat('2022-04-06 17:03:00') &nbsp&nbsp&nbsp  时间为 ${dateFormat('2022-04-06 17:03:00')} <br>`
    result1 += `dateFormat('2022-03-13 17:02:15') &nbsp&nbsp&nbsp  时间为 ${dateFormat('2022-03-13 17:02:15')} <br>`
    result1 += `dateFormat('22021-04-13 17:02:15') &nbsp&nbsp&nbsp  时间为 ${dateFormat('2021-04-13 17:02:15')} <br>`

    document.querySelector('#box1').innerHTML = result1
</script>
<hr>
<h2>快速获取当前时间</h2>
<div id="box2"></div>
<script>
    var result2 = ``
    result2 += `format('YmdHis') //  ${format('YmdHis')}<br />`
    result2 += `format('Y-m-d H:i:s') //  ${format('Y-m-d H:i:s')}<br />`
    result2 += `format('Y年m月d日 H:i:s') //  ${format('Y年m月d日 H:i:s')}<br />`
    result2 += "format('Y-m-d ') // " + format('Y-m-d') + "<br />"
    document.querySelector('#box2').innerHTML = result2;
</script>
<hr>

<h3 id="" style>随机选择十六进制颜色</h3>
<script>

    setInterval(function () { // 后续执行
        document.querySelector('h3').style.background = randomColor()
    }, 300)
</script>
<hr />

<h4>补零</h4>
<script>
    var temp = format('Y-m-d H:i:s')
    document.querySelector('h4').innerText = temp
    console.log('首次：刚打开浏览器就显示');
    setInterval(function () { // 后续执行
        console.log('后续')
        var temp = format('Y-m-d H:i:s')
        document.querySelector('h4').innerText = temp
    }, 1000)
</script>
<hr />

<h2>判断浏览器类型</h2>
<div id="box3"></div>
<script>
    document.querySelector('#box3').innerHTML = '这是：' + getOs()
</script>
<hr />

<h2>判断是PC还是移动端</h2>
<div id="box4"></div>
<script>
    document.querySelector('#box4').innerHTML = '判断为：' + getPCMob()
</script>
<hr />


<h2>判断是否微信登陆</h2>
<div id="box5"></div>
<script>
    document.querySelector('#box5').innerHTML ='判断为：' +isWeiXin()
</script>
<hr />

<h4 id="box6" style="color: rgb(26, 26, 123);">返回标签样式</h4>
<div ></div>
<script>
var result3 = ''
let Obj = document.querySelector('#box6')
result3 += `getStyle(Obj,'color')     ${getStyle(Obj,'color')}<br>`
result3 += `getStyle(Obj,'fontSize')  ${getStyle(Obj,'fontSize')}<br>`
result3 += `getStyle(Obj,'width')     ${getStyle(Obj,'width')}<br>`
document.querySelector('#box6').innerHTML = result3

</script>